﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Workflow.Alerts;


namespace Workflow.Layout.Layouts
{
    public partial class EmptyLayout : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            HideInvalidCss();
            var user = Session[WorkflowConstants.CurrentUser] as User;

            if (user.Type == WorkflowEnums.UserType.NetworkOperator)
            {
                MunicipalityName.Value = "/NetworkOperator/";
            }
            else
            {
                MunicipalityName.Value = string.Format("/{0}/", user.Name);
            }
        }

        /// <summary>
        /// Hides CSS file with invalid code
        /// </summary>
        private void HideInvalidCss()
        {
            if (Request.Browser.EcmaScriptVersion.Major <= 0 && Request.Browser.Frames == false && Request.Browser.Type == "Unknown" && Request.Browser.Browser == "Unknown")
            {
                phHideInvalidCss.Visible = false;
            }
        }
    }

}
